package edu.sctu.xialei.May.day20150518two.Int_ArrayList;

import java.util.ArrayList;

/**
 * Created by Administrator on 2015/5/18 0018.
 */
public class ArrayInt {

    public ArrayList Usage_ArrayList() {

        ArrayList List = new ArrayList();
        List.add(1);
        List.add(2);
        List.add(3);

        return List;
    }

    public int[] remove_ArrayList(ArrayList arrayList){


        arrayList.remove(2);

        arrayList.clear();

        arrayList.add(67);
        arrayList.add(67);
        arrayList.add(67);
        arrayList.add(67);

        arrayList.add(2,0);

        int[] array = new int[arrayList.size()];

        for (int i = 0; i < arrayList.size(); i++) {
            array[i] = (int) arrayList.get(i);
        }

        return array;
    }

    public void printer (int[] ints){
        for (int i = 0; i < ints.length; i++) {
            System.out.println(ints[i]);
        }
    }
}
